<%@ taglib prefix="from" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>书库管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/bookset/place/">书库列表</a></li>
		<li class="active"><a href="${ctx}/bookset/place/form?id=${bkPlace.placeid}">书库
            <shiro:hasPermission name="bookset:place:edit">${not empty bkPlace.placeid?'修改':'添加'}</shiro:hasPermission>
        </a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="bkPlace" action="${ctx}/bookset/place/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">书库编号:</label>
			<div class="controls">
				<form:input path="gcdCode" htmlEscape="false" maxlength="50" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">书库名称:</label>
			<div class="controls">
				<form:input path="gcdName" htmlEscape="false" maxlength="50" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否流通:</label>
			<div class="controls">
				是<input type="radio" name="isBorrow" id="isBorrow1" value="1" <c:if test="${bkPlace.isBorrow ne '0'}">checked="checked"</c:if>/>&nbsp;&nbsp;&nbsp;&nbsp;
			    否<input type="radio" name="isBorrow" id="isBorrow2" value="0" <c:if test="${bkPlace.isBorrow eq '0'}">checked="checked"</c:if>/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否计入资产:</label>
			<div class="controls">
				是<input type="radio" name="isCount" id="isCount1" value="1" <c:if test="${bkPlace.isCount ne '0'}">checked="checked"</c:if>/>&nbsp;&nbsp;&nbsp;&nbsp;
				否<input type="radio" name="isCount" id="isCount2" value="0" <c:if test="${bkPlace.isCount eq '0'}">checked="checked"</c:if>/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">是否为默认:</label>
			<div class="controls">
				是<input type="radio" name="isDefault" id="isDefault1" value="1" <c:if test="${bkPlace.isDefault ne '0'}">checked="checked"</c:if>/>&nbsp;&nbsp;&nbsp;&nbsp;
				否<input type="radio" name="isDefault" id="isDefault2" value="0" <c:if test="${bkPlace.isDefault eq '0'}">checked="checked"</c:if>/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注:</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="input-xlarge"/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="bookset:place:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>